package com.hbusa.cotroller.image;

import com.hbusa.dto.TbPicture;
import com.hbusa.service.impl.ImageServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @author XiaoXin
 * @date 2021/12/27 - 1:56
 */

@WebServlet("/admin/doList")
public class ListServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ImageServiceImpl imageService = new ImageServiceImpl();
        List<TbPicture> tbPictures = imageService.queryAll();
        req.setAttribute("tbPictures", tbPictures);
        req.getRequestDispatcher("/admin/image.jsp").forward(req, resp);
    }
}
